﻿using System.Collections.ObjectModel;
using MvvmFoundation.Wpf;
using WpfApplication1.Wpf;
using System.Data;

namespace WpfApplication1.TaskModule
{
    public class TasksViewModel : CrudViewModel<TaskItem>
    {
        private readonly ITaskItemsRepository _context;

        public TasksViewModel(ITaskItemsRepository context) : base(context)
        {
            _context = context;
        }

        protected override void Read()
        {
            Items.Clear();
            foreach (TaskItem taskItem in _context.Tasks)
            {
                Items.Add(taskItem);
            }
        }

    }
}